package com.bosicloud.cmb.ibp.api.manager.dao;

import com.bosicloud.cmb.ibp.api.manager.commom.model.IbpUserConsumerApi;
import com.bosicloud.cmb.ibp.api.manager.commom.vo.SubscribeApiListVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author Jack Peng / ziliang.peng@bosicloud.com
 */
public interface IbpUserConsumerApiMapper extends Mapper<IbpUserConsumerApi> {

    Integer insertIbpUserConsumerApi(IbpUserConsumerApi ibpUserConsumerApi);

    /**
     * 订阅列表
     *
     * @return
     */
    List<SubscribeApiListVO> subscribeApiList(@Param("currIndex") Integer currIndex,
                                              @Param("pageSize") Integer pageSize,
                                              @Param("userId") Integer userId);


    /**
     * 订阅
     *
     * @return int
     */
    int subscribeApiCount(Integer userId);


    IbpUserConsumerApi searchIbpUserConsumerApiFor(@Param("apiId") Integer apiId, @Param("userId") Integer userId);


    Integer deleteConsumerApi(@Param("apiId") Integer apiId, @Param("userId") Integer userId);

    Integer updateConsumerApi(IbpUserConsumerApi ibpUserConsumerApi);

}
